package com.cskaoyan.day11;

public class CastTest {
    public static void main(String[] args) {
        Animal animal= new Cat();
        animal.getSon(new Son()).test();
    }
}
class Father{
    public void test(){
    }
}
class Son extends Father{
    @Override
    public void test() {
        System.out.println("Son来也");
    }
}

class  Animal{
    public Father getSon(Son son){
        return son;
    }
}
class Cat extends Animal{
    @Override
    public Son getSon(Son son) {
        return son;
    }
}

